<?php
include dirname ( __FILE__ ) . '/common.php';
include ROOT_PATH.'include/HandlerFactory.class.php';
$request = new Request ();

if (! $request->isAjax ()) {
	header ( "HTTP/1.0 204" );
	exit ();
} else {
	try {
		$action = $request->getGet ( 'action' );
		if (empty ( $action )) {
			throw new ExceptionEx ( "Action not found" );
		}
		$hf = HandlerFactory::getSingleton ();
		$handler = $hf->createHandler ( $action );
		$handler->handle ();
	} catch ( ExceptionEx $e ) {
		// echo 204 status
		header ( "HTTP/1.0 204" );
		exit ();
	}
}